using System.Diagnostics.CodeAnalysis;

namespace MonoMod.Core.Interop
{
    internal static unsafe partial class CoreCLR
    {

        [SuppressMessage("Performance", "CA1812: Avoid uninstantiated internal classes",
            Justification = "It must be non-static to be able to inherit others, as it does. This allows the Core*Runtime types " +
            "to each reference exactly the version they represent, and the compiler automatically resolves the correct one without " +
            "needing duplicates.")]
        [SuppressMessage("Performance", "CA1852", Justification = "This type will be derived for .NET 8.")]
        public class V80 : V70
        {
            public new static class ICorJitInfoVtable
            {

                // src/coreclr/inc/corinfo.h
                // class ICorStaticInfo
                //  0: bool isIntrinsic(MethodDesc*)
                //  1: uint32_t getMethodAttribs(MethodDesc*)
                //  2: void setMethodAttribs(MethodDesc*, CorInfoMethodRuntimeFlags)
                //  3: void getMethodSig(MethodDesc*, CORINFO_SIG_INFO*, CORINFO_CLASS_HANDLE = null)
                //  4: bool getMethodInfo(MethodDesc*, CORINFO_METHOD_INFO*)
                //  5: bool haveSameMethodDefinition(CORINFO_METHOD_HANDLE, CORINFO_METHOD_HANDLE)
                //  6: CorInfoInline canInline(MethodDesc* caller, MethodDesc* callee)
                //  7: void beginInlining(MethodDesc*, MethodDesc*)
                //  8: void reportInliningDecision(MethodDesc*, MethodDesc*, CorInfoInline, char const*)
                //  9: bool canTailCall(MethodDesc*, MethodDesc*, MethodDesc*, bool)
                //  A: void reportTailCallDecision(MethodDesc*, MethodDesc*, bool, CorInfoTailCall, char const*)
                //  B: void getEHInfo(MethodDesc*, unsigned, CORINFO_EH_CLAUSE*)
                //  C: CORINFO_CLASS_HANDLE getMethodClass(MethodDesc*)
                //  D: void getMethodVTableOffset(MethodDesc*, unsigned*, unsigned*, bool*)
                //  E: bool resolveVirtualMethod(CORINFO_DEVIRTUALIZATION_INFO*)
                //  F: MethodDesc* getUnboxedEntry(MethodDesc*, bool*)
                // 10: CORINFO_CLASS_HANDLE getDefaultComparerClass(CORINFO_CLASS_HANDLE)
                // 11: CORINFO_CLASS_HANDLE getDefaultEqualityComparerClass(CORINFO_CLASS_HANDLE)
                // 12: void expandRawHandleIntrinisc(CORINFO_RESOLVED_TOKEN*, CORINFO_GENERICHANDLE_RESULT*)
                // 13: bool isIntrinsicType(CORINFO_CLASS_HANDLE)
                // 14: CorInfoCallConvExtension getUnmanagedCallConv(MethodDesc*, CORINFO_SIG_INFO*, bool*)
                // 15: bool pInvokeMarshallingRequired(MethodDesc*, CORINFO_SIG_INFO*)
                // 16: bool satisfiesMethodConstraints((CORINFO_CLASS_HANDLE, MethodDesc*)
                // 17: void methodMustBeLoadedBeforeCodeIsRun(MethodDesc*)
                // 18: MethodDesc* mapMethodDeclToMethodIMpl(MethodDesc*)
                // 19: void getGSCookie(GSCookie*, GSCookie**)
                // 1A: void setPatchpointInfo(PatchpointInfo*)
                // 1B: PatchpointInfo* getOSRInfo(unsigned*)
                // 1C: void resolveToken(CORINFO_RESOLVED_TOKEN*)
                // 1D: void findSig(CORINFO_MODULE_HANDLE, unsigned, CORINFO_CONTEXT_HANDLE, CORINFO_SIG_INFO*)
                // 1E: void findCallSiteSig(CORINFO_MODULE_HANDLE, unsigned, CORINFO_CONTEXT_HANDLE, CORINFO_SIG_INFO*)
                // 1F: CORINFO_CLASS_HANDLE getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN*)
                // 20: int getStringLiteral(CORINFO_MODULE_HANDLE, unsigned, char16_t*, int)
                // 21: size_t printObjectDescription (CORINFO_OBJECT_HANDLE, char*, size_t, size_t*)
                // 22: CorInfoType asCorInfoType(CORINFO_CLASS_HANDLE)
                // 23: char const* getClassNameFromMetadata(CORINFO_CLASS_HANDLE, char const**)
                // 24: CORINFO_CLASS_HANDLE getTypeInstantiationArgument(CORINFO_CLASS_HANDLE, unsigned)
                // 25: size_t printClassName(CORINFO_CLASS_HANDLE, char*, size_t, size_t*)
                // 26: bool isValueClass(CORINFO_CLASS_HANDLE)
                // 27: CorInfoinlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_HANDLE, CorInfoInlineTypeCheckSource)
                // 28: uint32_t getClassAttribs(CORINFO_CLASS_HANDLE)
                // 29: CORINFO_MODULE_HANDLE getClassModule(CORINFO_CLASS_HANDLE)
                // 2A: CORINFO_ASSEMBLY_HANDLE getModuleAssembly(CORINFO_MODULE_HANDLE)
                // 2B: char const* getAssemblyName(CORINFO_ASSEMBLY_HANDLE)
                // 2C: void* LongLifetimeMalloc(size_t)
                // 2D: void LongLifetimemFree(void*)
                // 2E: size_t getClassModuleIdForStatics(CORINFO_CLASS_HANDLE, CORINFO_MODULE_HANDLE*, void**)
                // 2F: bool getIsClassInitedFlagAddress(CORINFO_CLASS_HANDLE, CORINFO_CONST_LOOKUP*, int*)
                // 30: bool getStaticBaseAddress(CORINFO_CLASS_HANDLE, bool, CORINFO_CONST_LOOKUP*)
                // 31: unsigned getClassSize(CORINFO_CLASS_HANDLE)
                // 32: unsigned getHeapClassSize(CORINFO_CLASS_HANDLE)
                // 33: bool canAllocateOnStack(CORINFO_CLASS_HANDLE)
                // 34: unsigned getClassAlignmentRequirement(CORINFO_CLASS_HANDLE, bool=false)
                // 35: unsigned getClassGClayout(CORINFO_CLASS_HANDLE, uint8_t*)
                // 36: unsigned getClassNumInstanceFields(CORINFO_CLASS_HANDLE)
                // 37: CORINFO_FIELD_HANDLE getFieldInClass(CORINFO_CLASS_HANDLE, int32_t)
                // 38: GetTypeLayoutResult getTypeLayout(CORINFO_CLASS_HANDLE, CORINFO_TYPE_LAYOUT_MODE*, size_t*)
                // 39: bool checkMethodModifier(MethodTable*, char const*, bool)
                // 3A: CorInfoHelpFunc getNewHelper(CORINFO_RESOLVED_TOKEN*, MethodTable*, bool*)
                // 3B: CorInfoHelpFunc getNewArrHelper(CORINFO_CLASS_HANDLE)
                // 3C: CorInfoHelpFunc getCastingHelper(CORINFO_RESOLVED_TOKEN*, bool)
                // 3D: CorInfoHelpFunc getSharedCCtorHelper(CORINFO_CLASS_HANDLE)
                // 3E: CORINFO_CLASS_HANDLE getTypeForBox(CORINFO_CLASS_HANDLE)
                // 3F: CorInfoHelpFunc getBoxHelper(CORINFO_CLASS_HANDLE)
                // 40: CorInfoHelpFunc getUnBoxHelper(CORINFO_CLASS_HANDLE)
                // 41: CORINFO_OBJECT_HANDLE getRuntimeTypePointer(CORINFO_CLASS_HANDLE)
                // 42: bool isObjectImmutable(CORINFO_OBJECT_HANDLE)
                // 43: bool getStringChar(CORINFO_OBJECT_HANDLE, int, uint16_t*)
                // 44: CORINFO_CLASS_HANDLE getObjectType(CORINFO_OBJECT_HANDLE)
                // 45: bool getReadyToRunHelper(CORINFO_RESOLVED_TOKEN*, CORINFO_LOOKUP_KIND*, CorInfoHelpFunc, CORINFO_CONST_LOOKUP*)
                // 46: void getReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN*, mdToken, CORINFO_CLASS_HANDLE, CORINFO_LOOKUP*)
                // 47: CorInfoInitClassResult initClass(CORINFO_FIELD_HANDLE, CORINFO_METHOD_HANDLE, CORINFO_CONTEXT_HANDLE)
                // 48: void classMustBeLoadedBeforeCodeIsRun(CORINFO_CLASS_HANDLE)
                // 49: CORINFO_CLASS_HANDLE getBuiltinClass(CorInfoClassId)
                // 4A: CorInfoType getTypeForPrimitiveValueClass(CORINFO_CLASS_HANDLE)
                // 4B: CorInfoType getTypeForPrimitiveNumericClass(CORINFO_CLASS_HANDLE)
                // 4C: bool canCast(CORINFO_CLASS_HANDLE)
                // 4D: TypeCompareState compareTypesForCast(CORINFO_CLASS_HANDLE, CORINFO_CLASS_HANDLE)
                // 4E: TypeCompareState compareTypesForEquality(CORINFO_CLASS_HANDLE, CORINFO_CLASS_HANDLE
                // 4F: bool isMoreSpecificType(CORINFO_CLASS_HANDLE, CORINFO_CLASS_HANDLE)
                // 50: TypeCompareState isEnum(CORINFO_CLASS_HANDLE, CORINFO_CLASS_HANDLE*)
                // 51: CORINFO_CLASS_HANDLE getParentType(CORINFO_CLASS_HANDLE)
                // 52: CorInfoType getChildType(CORINFO_CLASS_HANDLE, CORINFO_CLASS_HANDLE*)
                // 53: bool isSDArray(CORINFO_CLASS_HANDLE)
                // 54: unsigned getArrayRank(CORINFO_CLASS_HANDLE)
                // 55: CorInfoArrayIntrinsic getArrayIntrinsicID(CORINFO_METHOD_HANDLE)
                // 56: void* getArrayInitializationData(CORINFO_FIELD_HANDLE, uint32_t)
                // 57: CorInfoIsAccessAllowedResult canAccessClass(CORINFO_RESOLVED_TOKEN*, CORINFO_METHOD_HANDLE, CORINFO_HELPER_DESC*)
                // 58: size_t printFieldName(CORINFO_FIELD_HANDLE, char*, size_t, size_t*)
                // 59: CORINFO_CLASS_HANDLE getFieldClass(CORINFO_FIELD_HANDLE)
                // 5A: CorInfoType getFieldType(CORINFO_FIELD_HANDLE, CORINFO_CLASS_HANDLE*, CORINFO_CLASS_HANDLE)
                // 5B: unsigned getFieldOffset(CORINFO_FIELD_HANDLE)
                // 5C: void getFieldInfo(CORINFO_RESOLVED_TOKEN*, CORINFO_METHOD_HANDLE, CORINFO_ACCESS_FLAGS, CORINFO_FIELD_INFO)
                // 5D: uint32_t getThreadLocalFieldInfo(CORINFO_FIELD_HANDLE, bool)
                // 5E: void getThreadLocalStaticBlockInfo(CORINFO_THREAD_STATIC_BLOCKS_INFO*, bool)
                // 5F: bool isFieldStatic(CORINFO_FIELD_HANDLE)
                // 60: int getArrayOrStringLength(CORINFO_OBJECT_HANDLE)
                // 61: void getBoundaries(CORINFO_METHOD_HANDLE, unsigned int*, uint32_t**, ICorDebugInfo::BoundaryTypes*)
                // 62: void setBoundaries(CORINFO_METHOD_HANDLE, uint32_t, ICorDebugInfo::OffsetMapping*)
                // 63: void getVars(CORINFO_METHOD_HANDLE, uint32_t*, ICorDebugInfo::ILVarInfo**, bool*)
                // 64: void setVars(CORINFO_METHOD_HANDLE, uint32_t, ICorDebugINfo:;NativeCatInfo*)
                // 65: void reportRichMappings(ICorDebugInfo::InlineTreeNode*, uint32_t, ICodDebugInfo::RichOffsetMapping*, uint32_t)
                // 66: void* allocateArray(size_t)
                // 67: void freeArray(void*)
                // 68: CORINFO_ARG_LIST_HANDLE getArgNext(CORINFO_ARG_LIST_HANDLE)
                // 69: CorInfoTypeWithMod getArgType(CORINFO_SIG_INFO*, CORINFO_ARG_LIST_HANDLE, CORINFO_CLASS_HANDLE*)
                // 6A: int getExactClasses(CORINFO_CLASS_HANDLE, int, CORINFO_CLASS_HANDLE*)
                // 6B: CORINFO_CLASS_HANDLE getArgClass(CORINFO_SIG_INFO*, CORINFO_ARG_LIST_HANDLE)
                // 6C: CorInfoHFAElemType getHFAType(CORINFO_CLASS_HANDLE)
                // 6D: bool runWithErrorTrap(errorTrapFunction, void*)
                // 6E: bool runWithSPMIErrorTrap(errorTrapFunction, void*)
                // 6F: void getEEInfo(CORINFO_EE_INFO*)
                // 70: char16_t const* getJitTimeLogFilename()
                // 71: mdMethodDef getMethodDefFromMethod(CORINFO_METHOD_HANDLE)
                // 72: size_t printMethodName(CORINFO_METHOD_HANDLE, char*, size_t, size_t*)
                // 73: char const* getMethodNameFromMetadata(CORINFO_METHOD_HANDLE, char const**, char const**, char const**)
                // 74: unsigned getMethodHash(CORINFO_METHOD_HANDLE)
                // 75: bool getSystemVAmd64PassStructInRegisterDescriptor(CORINFO_CLASS_HANDLE, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR)
                // 76: uint32_t getLoongArch64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE)
                // 77: uint32_t getRISCV64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE)

                // src/coreclr/inc/corinfo.h
                // class ICorDynamicInfo : public ICorStaticInfo
                // 78: uint32_t getThreadTLSIndex(void**=null)
                // 79: int32_t* getAddrOfCaptureThreadGlobal(void**=null)
                // 7A: void* getHelperFtn(CorInfoHelpFunc,void**=null)
                // 7B: void getFunctionEntryPoint(CORINFO_METHOD_HANDLE, CORINFO_CONST_LOOKUP*, CORINFO_ACCESS_FLAGS=ANY)
                // 7C: void getFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE, bool, CORINFO_CONST_LOOKUP*)
                // 7D: void* getMethodSync(CORINFO_METHOD_HANDLE, void**=null)
                // 7E: CorInfoHelpFunc getLazyStringLiteralHelper(CORINFO_MODULE_HANDLE)
                // 7F: CORINFO_MODULE_HANDLE embedModuleHandle(CORINFO_MODULE_HANDLE, void**=null)
                // 80: CORINFO_CLASS_HANDLE embedClassHandle(CORINFO_CLASS_HANDLE, void**=null)
                // 81: CORINFO_METHOD_HANDLE embedMethodHandle(CORINFO_METHOD_HANDLE, void**=null)
                // 82: CORINFO_FIELD_HANDLE embedFieldHandle(CORINFO_FIELD_HANDLE, void**=null)
                // 83: void embedGenericHandle(CORINFO_RESOLVED_TOKEN*, bool, CORINFO_GENERICHANDLE_RESULT*)
                // 84: void getLocationOfThisType(CORINFO_METHOD_HANDLE, CORINFO_LOOKUP_KIND*)
                // 85: void getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE, CORINFO_CONST_LOOKUP*)
                // 86: void* GetCookieForPINvokeCalliSig(CORINFO_SIG_INFO*, void**=null)
                // 87: bool canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO*)
                // 88: CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(CORINFO_METHOD_HANDLE, CORINFO_JUST_MY_CODE_HANDLE**=null)
                // 89: void GetProfilingHandle(bool*, void**, bool*)
                // 8A: void getCallInfo(CORINFO_RESOLVED_TOKEN*, CORINFO_RESOLVED_TOKEN*, CORINFO_METHOD_HANDLE, CORINFO_CALLINFO_FLAGS, CORINFO_CALL_INFO*)
                // 8B: unsigned getClassDomainID(CORINFO_CLASS_HANDLE, void**=null)
                // 8C: bool getStaticFieldContent(CORINFO_FIELD_HANDLE, uint8_t, int, int, bool)
                // 8D: bool getObjectContent(CORINFO_OBJECT_HANDLE, uint8_t*, int, int)
                // 8E: CORINFO_CLASS_HANDLE getStaticFieldCurrentClass(CORINFO_FIELD_HANDLE, bool*=null)
                // 8F: CORINFO_VARARGS_HANDLE getVarArgsHandle(CORINFO_SIG_INFO*, void**=null)
                // 90: bool canGetVarArgsHandle(CORINFO_SIG_INFO*)
                // 91: InfoAccessType constructStringLiteral(CORINFO_MODULE_HANDLE, mdToken, void**)
                // 92: InfoAccessType emptyStringLiteral(void**)
                // 93: uint32_t getFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE, void**=null)
                // 94: CORINFO_METHOD_HANDLE GetDelegateCtor(CORINFO_METHOD_HANDLE< CORINFO_CLASS_HANDLE, CORINFO_METHOD_HANDLE, DelegateCtorArgs*)
                // 95: void MethodCompileComplete(CORINFO_METHOD_HANDLE)
                // 96: bool getTailCallHelpers(CORINFO_RESOLVED_TOKEN*, CORINFO_SIG_INFO*, CORINFO_GET_TAILCALL_HELPERS_FLAGS, CORINFO_TAILCALL_HELPERS*)
                // 97: bool convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN*, bool)
                // 98: bool notifyInstructionSetUsage(CORINFO_InstructionSet, bool)
                // 99: void updateEntryPointForTailCall(CORINFO_CONST_LOOKUP*)

                // src/coreclr/inc/corjit.h
                // class ICorJitInfo : public ICorDynamicInfo
                // 9A: void allocMem(AllocMemArgs*)
                public const int AllocMemIndex = 0x9A;
                // 9B: void reserveUnwindInfo(bool, bool, uint33_t)
                // 9C: void allocUnwindInfo(uint8_t*, uint8_t*, uint32_t, uint32_t, uint32_t, uint8_t*, CorJitFuncKind)
                // 9D: void* allocGCInfo(size_t)
                // 9E: void setEHcount(unsigned)
                // 9F: void setEHinfo(unsigned, CORINFO_EH_CLAUSE const*)
                // A0 bool logMsg(unsigned, char const*, va_list)
                // A1: int doAssert(char const*, int, char const*)
                // A2: void reportFatalError(CorJitResult)
                // A3: JITINTERFACE_HRESULT getPgoInstrumentationResults(CORINFO_METHOD_HANDLE, PgoInstrumentationSchema**, uint32_t*, uint8_t**, PgoSource*)
                // A4: JITINTERFACE_HRESULT allocPgoInstrumentationBySchema(CORINFO_METHOD_HANDLE, PgoInstrumentationSchema*)
                // A5: void recordCallSite(uint32_t, CORINFO_SIG_INFO*, CORINFO_METHOD_HANDLE)
                // A6: void recordRelocation(void*, void*, void*, uint16_t, uint16_t, int32_t)
                // A7: uint16_t getRelocTypeHind(void*)
                // A8: uint32_t getExpectedTargetArchitecture()
                // A9: uint32_t getJitFlags(CORJIT_FLAGS*, uint32_t)

                public const int TotalVtableCount = 0xAA;
            }
        }
    }
}
